<%@page import="com.mbbmap.util.EncryptionHelper"%>
<nav id="topNav">
	<ul>
		<li class="last"><span class="title"><%=EncryptionHelper.decrypt(request.getParameter("report_title"))%><button class="btn" style="margin-left:5px; margin-top:-5px; padding-bottom:10px"><span class="caret" style="position:relative; top:0px; left:-1px;"></span></button></span>
			<ul class="dropdown-menu">
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=closed_report">Closed & Rejected Report</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=decisioning_report">Decisioning Report</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=exceptional_report">Exceptional Report</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=external_sla_process">External SLA Report by Process</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=processing_productivity_report">Processing Productivity Report</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=region_sla">Region Report (Non MY)</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=sales_productivity_report">Sales Productivity Report</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=sla_individual_report">SLA by Individual Status Report</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=sla_process">SLA Report by Process</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=status_report">Status Report</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=summary_report">Summary Report</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=terminal_installation">Terminal Installation Report</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=terminal_summary">Terminal Summary Report</a></li>
				<li><a href="<%=request.getContextPath()%>/Report.do?dispatch=trf_report">TRF Report</a></li>
			</ul>        
		</li>
	</ul>
</nav>


<script>
	(function($){
		//cache nav
		var nav = $("#topNav");
		
		var title_width = $('span.title').width();
		var menu_width = $('ul.dropdown-menu').width() / 2;
		var left = (title_width - menu_width) + 'px';
		$('ul.dropdown-menu').css('left',left);
		
		//add indicator and hovers to submenu parents
		nav.find("li").each(function() {
			if ($(this).find("ul").length > 0) {

				//show subnav on hover
				$('button.btn').click(function() {
					$('li.last').find("ul").stop(true, true).slideToggle();
				});
				
				//hide submenus on exit
				// $(this).mouseleave(function() {
					// $(this).find("ul").stop(true, true).slideUp();
				// });
				
				$(document).mouseup(function (e){
					if (nav.has(e.target).length === 0){
						nav.find("li").find("ul").stop(true, true).slideUp();
					}
				});
			}
		});
		
		
	})(jQuery);
</script>